<template>
    <div class="login">
        <vue-particles :particles-number="200"
                   color="#ffffff"
                   :size="3"
                   shapeType="star"></vue-particles>
      <transition name="el-zoom-in-top">
        <div v-show="show2" class="transition-box">
          <h1 style="margin-top: 50px;">欢迎光临</h1>
          <div class="inputs" style="margin-top: 30px;">
            <label for="a" class="las">用户名:</label>
            <input type="text" name="" id="a" class="ins">
          </div>
          <div class="inputs">
            <label for="b" class="las">密   码:</label>
            <input type="password" name="" id="b" class="ins">
          </div>
          <button class="dls" @click="f1">登录</button>
        </div>
      </transition>
    </div>
  </template>
  

<script>
import {useRouter} from 'vue-router'
import {ref,onMounted} from 'vue'


export default {
setup(){
    const router = useRouter()
    let show2=ref(false)
    let input1=ref('')
    onMounted(()=>{
        setTimeout(()=>{
            show2.value=true
        },500)
    })
    function f1(){
        router.push({name:'home'})
    }
    return{
        show2,
        input1,
        f1
    }
}
}
</script>

<style lang="less" scoped>
.login{
    width: 100vw;
    height: 100vh;
    background: url(../assets/yidong.jpg) 50% 50% no-repeat;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
}
.transition-box {
    // position: absolute;
        width: 500px;
        height: 350px;
        left: 50%;
        top: 50%;
        // transform: translate(-50%,-50%);
        background-color: rgba(255, 255, 255, 0.714);
        border-radius: 20px;
        text-align: center;
        .inputs{
            margin: auto;
            margin-top: 10px;
            width: 260px;
            height: 40px;
            .las{
                float: left;
            }
            .ins{
                float: right;
            }
        }
  }
  input{
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #dcdfe6;
    box-sizing: border-box;
    color: #606266;
    font-size: inherit;
    height: 30px;
    line-height: 30px;
    padding: 0 15px;
    width: 190px;
  }
  .dls{
    margin-top: 30px;
    width: 170px;
    height: 30px;
    background-color: rgba(251, 251, 251, 0.585);
    border: none;
    border-radius: 5px;
    font-size: 20px;
  }
</style>